package cn.hotel.utlis;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class Read {
    Properties properties = new Properties();

    private Read(){
        String s = "database.properties";
        InputStream inputStream = Read.class.getClassLoader().getResourceAsStream(s);
        try {
            properties.load(inputStream);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    private static Read read = null;
    public static synchronized Read getRead(){
        if(read == null){
            read = new Read();
        }
        return read;
    }

    public String getString(String key){
        return properties.getProperty(key);
    }
}
